package com.kevin.mybatis.pojo;

public enum SexEnum {
    MALE(1l,"男"),
    FEMALE(0l,"女");
    private Long id;
    private String sex;

    SexEnum(Long id, String sex) {
        this.id = id;
        this.sex = sex;
    }

    public static SexEnum getSexById(long id){
        for (SexEnum sex: SexEnum.values()){
            if (id==sex.getId()){
                return sex;
            }
        }
        return null;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
}
